package com.vkmessenger.gui.activities.contacts;

import android.os.Bundle;
import com.android.internal.util.Predicate;
import com.vkmessenger.net.json.FriendsResponse;

/**
 * Created by IntelliJ IDEA.
 * User: Evgeniy Krasko
 * Date: 30.05.12
 * Time: 13:15
 */
public class OnlineActivity extends CommonContactsActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected boolean drawOnline() {
        return false;
    }

    @Override
    public Predicate<FriendsResponse.FriendResponse> getFilter() {
        return new Predicate<FriendsResponse.FriendResponse>() {
            Predicate<FriendsResponse.FriendResponse> namePred = getFilterByName(search.getText().toString());

            public boolean apply(FriendsResponse.FriendResponse friend) {
                return "1".equals(friend.online) && namePred.apply(friend);
            }
        };
    }


}
